type role
とある型の分類
他の分類法としてはkindとかがあるmrsekut.icon
二つの型が同じ表現を持つ型かどうかを判断する
2つの型同士が安全にキャスト可能かどうかを知りたいときに使う
3種類ある
nominal
representational
phantom
#WIP
GeneralizedNewtypeDeriving
RoleAnnotations
Generative Type Abstraction and Type-level Computation
論文
https://github.com/purescript/documentation/blob/master/language/Roles.md
purs
pursuitにちゃんと表示される
https://gyazo.com/07218956c0deafabfcb9aa6534e8d8ea https://pursuit.purescript.org/packages/purescript-homogeneous/0.4.0/docs/Data.Homogeneous.Record#t:Homogeneous
https://downloads.haskell.org/~ghc/7.10.1/docs/html/users_guide/roles.html
https://haskell.jp/blog/posts/2017/13-about-kind-system-part2.html#%E3%82%82%E3%81%86%E4%B8%80%E3%81%A4%E3%81%AE%E5%9E%8B%E3%81%AE%E5%88%86%E9%A1%9E
https://gitlab.haskell.org/ghc/ghc/-/wikis/roles
https://wiki.haskell.org/Roles
https://qiita.com/hiratara/items/888bdae1455fd7c4a5f0
https://courses.lumenlearning.com/sac-artappreciation/chapter/oer-1-4/
https://discourse.purescript.org/t/what-is-a-role/2109
https://github.com/purescript/purescript/issues/3882
https://github.com/purescript/purescript/issues/3868
https://www.reddit.com/r/haskell/comments/72zdwm/use_cases_for_type_classes_with_representational/